gdkglcontext-win32.c: Fix running with Mesa drivers
authorChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 29 Apr 2021 04:04:42 +0000 (12:04 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 29 Apr 2021 04:12:01 +0000 (12:12 +0800)
commit66e7f3b404405cafa2e026be7273b6d280ccf88e
tree20df5cc2c10b7c79b520abd4b0265f4c33013a39
parent604d171d5661f6eb51d385b8eb8485c96da7608b
gdkglcontext-win32.c: Fix running with Mesa drivers

Some GL drivers such as Mesa-D3D12 do not allow one to call SetPixelFormat() on
a given HDC if one pixel format has been already set for it, so first check the
HDC with GetPixelFormat() to see whether a pixel format has already been set
with the HDC, and only attempt to acquire the pixel format if one has not been
set.

This will fix running with GL/NGL on Windows using the Mesa drivers.
gdk/win32/gdkglcontext-win32.c